<template>
	<div class="container last_container">
		<el-table height="500" v-loading="tableLoading" :data="tableData" highlight-current-row>
			<el-table-column property="order_consignee" label="收货人名称" align="center"></el-table-column>
			<el-table-column property="order_consignee_addr" label="收货地址" align="center"></el-table-column>
			<el-table-column property="order_consignee_addr_detail" label="详细收货地址" align="center"></el-table-column>
			<el-table-column property="order_consignee_tel" label="收货人手机号" align="center"></el-table-column>
			<div slot="empty">
				<el-empty description=" "></el-empty>
			</div>
		</el-table>
	</div>
</template>

<script>
	const __name = 'wmzmall-order';
	export default {
		data() {
			return {
				dataId: '',
				tableLoading: false,
				tableData: []
			};
		},
		methods: {
			async loadData(callback) {
				this.tableLoading = true;
				await this.$db[__name]
					.noaction()
					.noshopid()
					.where({
						order_id: this.dataId
					})
					.tofirst({
						loading: false
					})
					.then(res => {
						if (res.code == 200) {
							this.tableData.push(res.datas);

							if (typeof callback === 'function') {
								callback();
							}
						}
						this.tableLoading = false;
					});
			}
		},
		created() {
			this.dataId = this.$route.query.order_id || '';

			this.loadData(() => {
				this.$nextTick(() => {
					this.$api.scrollToStorage('.el-table__body-wrapper', this.$route.path + '-consignee');
				});
			});
		},
		mounted() {
			this.$nextTick(() => {
				this.$api.scrollOnStorage('.el-table__body-wrapper', this.$route.path + '-consignee');
			});
		}
	};
</script>

<style></style>
